import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import App from './App.vue';
import router from './router';
import VueCookies from 'vue-cookies';
router.beforeEach((to, from, next) => {
    if (to.path=="/") {
        if  ( sessionStorage.getItem('identity')=='tea' || VueCookies.get('identity')=='tea') {
            router.push({path: '/teamemu/list'});
        }else if  ( sessionStorage.getItem('identity')=='stu'  || VueCookies.get('identity')=='stu') {
            router.push({path: '/stumemu/choess'});
        } else {
            router.push({path: '/login'});
            console.log(VueCookies.keys());
        }
    }
    next();

})
export const app= createApp(App)
app.use(ElementPlus)
app.use(router)
// app.use(VueCookies)
app.mount('#app')
